﻿@* Licensed to the Chroma Control Contributors under one or more agreements. *@
@* The Chroma Control Contributors licenses this file to you under the MIT license. *@
@* See the LICENSE file in the project root for more information. *@

<div class="dialog" style="width: @(Width)px; @(Height != 0 ? $"min-height: {Height}px; height: {Height}px;" : "")">
    @if (Title != null)
    {
        <div class="dialog-header">
            <h1 class="dialog-header-text">
                @Title
            </h1>
            <button class="dialog-header-button" aria-label="Close" @onclick="() => DialogService.Close()">
                <svg aria-hidden="true" class="dialog-header-button-icon" version="1.1" tabindex="-1" viewBox="0 0 16 16" height="16" width="16">
                    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
                </svg>
            </button>
        </div>
    }
    <form class="dialog-body-container">
        <fieldset class="dialog-body">
            <div class="dialog-content @PaddingClass @ScrollableClass">
                @Content
            </div>
            <div class="dialog-footer">
                @AdditionalButtons
                <Button @onclick="() => DialogService.Close()" Style="Button.StyleType.Secondary">@CancelText</Button>
            </div>
        </fieldset>
    </form>
</div>
